home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 1 / your choice.zip / your choice / OS2 / LW22 / OS2SWQDL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-04-20  |  7KB  |  173 lines

  1. /* LiveWire Offline OS2Shareware BBS REXX Script File    OS2SWQDL.CMD */
  2.  
  3. /* This script log's on to Pete's board, Captures New Messages and Files
  4.    Downloads your Qwk Messages and the latest OS2NEW.ZIP files and exits.
  5.    After this I use a second script that just gets me to the main menu
  6.    (actually just the first section of this script) I then manually
  7.    upload my qwk replies and download any files of interest. You might
  8.    like to automate this second Pass, but I'm new to Qwk and havent thought 
  9.    out the "sync" problems with a script that uploads prior replies before
  10.    downloading current messages. ( I use and like, MR2 to read offline QWKs)
  11.    Anyway feel free to use the script or any portion of it. I borrowed the 
  12.    initial Do Loop from someone elses example (Sorry I've forgotten your 
  13.    full name Jonathan DBP??) Hope this is a usefull example of Rexx and LW
  14.    
  15.                                     Kenn Lynch Sat 03-19-1994   
  16.                                     
  17.    You should edit the paths e:\download and d:\lwos2 
  18.    to match your own paths. Enter your own name and password, in the variables
  19.    The script also assumes you have unzip and its in your current path.
  20.    Enter the scripts name in the LW dialing directory entry for OS2 SW BBS.
  21.    You can rename this script, but extension must be .CMD to work in LW */             
  22.  
  23.  
  24. /* Set timeout */
  25. SetLW(TimeOut,120);
  26.  
  27. /* Set inter-character pacing to 40ms */
  28. SetLW(Pacing,40);
  29.  
  30. /* Set emulation and toggles */
  31. SetLW(Emulation,1);
  32. SetLW(Echo,0);
  33. SetLW(Linefeeds,0);
  34. SetLW(XonXoff,0);
  35. SetLW(BSIsDel,1);
  36.  
  37. /* I pre-load my strings with backspaces to avoid line noise. 
  38.    I have never had this problem with Pete's board, 
  39.    but its needed on some others I've used 
  40.    What LiveWire needs is a way to store ENCRYPTED passwords and pass them
  41.    to the script(or encrypt the script) I prefer to keep my password in the
  42.    script file rather than in the dialing directory, neither is secure! */
  43.     
  44.  Username = "^H^H^H^H^H^H^Hyour name" /* your first and last name */
  45.  Password = "^H^H^H^Hyour password"   /* Your password here */
  46.  /* The "REM" on the following line seems to enable the Ctrl break exit
  47.     to work correctly. Believe this will be fixed in LW 2.2 */
  48. REM      
  49.    SendLW("^M");
  50.  
  51.    Do forever
  52.  
  53.       ret=FindLW("wait 20 seconds",
  54.                    ,"your name:",
  55.                    ,"[Y,n]?",
  56.                    ,"Password:",
  57.                    ,"ss ENTER to continue");
  58.  
  59.       select
  60.        when ret="wait 20 seconds"       then SendLW("^[") ;
  61.        when ret="your name:"            then SendLW(Username||"^M") ;
  62.        when ret="[Y,n]? "               then SendLW("Y^M") ;
  63.        when ret="Password:"             then SendLW(Password||"^M") ;
  64.        when ret="ss ENTER to continue " then Leave ;
  65.                                        
  66.        otherwise
  67.           /*  The only thing that usually will bring you here is   */
  68.           /*  a timeout.  What you do here is up to you.  I just   */
  69.           /*  panic myself. (this DO was borrowed from JDBP)       */
  70.           Say "SCRIPT FAILED (prompts changed?)!!!! prompt was " ret;
  71.                
  72.        end
  73.    end
  74.  
  75.     SendLW("^M");
  76.  
  77. /* We're in now, time for a little local house keeping,    You can modify this 
  78.    part to suit your needs. what I do is a keep the last 2 session logs.
  79.    Livewire 2.1 now correctly appends to previous log, but I dont like to
  80.    page foreward through the old stuff. Since I've been using QWK packets
  81.    The log doesnt contain any messages, only thing of interest is the new
  82.    files. I've started using LWs scroll back to view them so this capture file
  83.    is less usefull. By the way the capture file and os2new.txt are left in the
  84.    LiveWire directory you might like to path them to your download dir instead.
  85. */   
  86.  
  87. /* save old capture file to os2sw-1.cap delete the original, Capture on */ 
  88.  
  89.    'copy os2sw.cap os2sw-1.cap';
  90.    'del os2sw.cap';
  91.     SetLW(Capture, ON,"os2sw.CAP");
  92.  
  93. /* Capture mail to log file, may not be needed if they are received in Qwk */
  94.  
  95.     ret=FindLW("r mail? [Y,n]");
  96.     DelayLW(100);
  97.     SendLW("N");
  98.  
  99. /*  Get whats newer than os2new.zip (todays uploads) */
  100.  
  101.     ret=FindLW(" files? [Y,n]");
  102.     DelayLW(100);
  103.     SendLW("Y^M");
  104.  
  105.     ret=FindLW("ss ENTER to continue ");
  106.     DelayLW(100);
  107.     SendLW("^M");
  108.  
  109. /* go from the main menu to the offline menu, dl QWKs from the forums you 
  110.    preselected in the offline area 
  111.    Note I just experienced a problem that occurs when you have more than 
  112.    10 previous Qwk message files, the Zmodem rename fails It appears you
  113.    can loose the packet this way ! Best do regular houskeeping in your qwk 
  114.    reader or add some lines here to rename older message packets 
  115.     */
  116.    
  117.     ret=FindLW("Select:");
  118.     DelayLW(100);
  119.     SendLW("od^M");
  120.                   
  121.  
  122. /* this logic assumes that once you enter the Offline are if there are no
  123.    messages, you are sent back to Main Menu, If there are messages you are
  124.    prompted to enter a return or wait for dl to start, and finally, an Xon 
  125.    (^Q) is sent after download is completed, an "M" returns you to Main Menu
  126.    Sometimes the Xon is not caught? so also uses the "READER: to jump to Main*/
  127.  
  128.  
  129.    Do Forever
  130.      ret=FindLW("abort","","READER:","MAIN:");
  131.      select
  132.        when ret="abort"                   then SendLW("^M") ;
  133.        when ret=""                       then SendLW("M");
  134.        when ret="READER:"                 then SendLW("M"; 
  135.        when ret="MAIN:"                   then Leave;
  136.        otherwise    
  137.        Say "SCRIPT FAILED (prompts changed?)!!!! prompt was " ret;
  138.        exit;  
  139.      end;
  140.    end;     
  141.  
  142.  
  143. /*     Go to the files section, delete prior os2new.zip, dl latest os2new.zip 
  144.     There seems to still be a minor bug in LW2.1s Capture off, If you watch
  145.     your screen you'll note Capture is turned ON instead of OFF?
  146.     Les Novell said he'll fix this one in LW 2.2) */ 
  147.  
  148.     'del e:\download\os2new.zip'; 
  149.     SetLW(Capture,OFF);          /* This used to work. bug in LW2.1? */ 
  150.     DelayLW(100);
  151.     SendLW("FDOS2NEW^M");                   
  152.  
  153.     ret=FindLW("s) to download ");
  154.     DelayLW(100);
  155.     SendLW("^M^M");
  156.     
  157. /* I had problems using the /g (goodbye after dl) method. Could not find a
  158.    sucessful string to catch in the countdown. I think there are ANSI cursor 
  159.    positioning characters in the countdown numbers. I hope the abrupt hangup
  160.    doesnt cause any odd status on Petes Board? 
  161.    After download, hangup, del prior os2new.txt, unzip latest os2new.txt */ 
  162.  
  163.     ret=FindLW("");
  164.     DelayLW(100);
  165.     HangUpLW();
  166.  
  167.    'del d:\lwos2\os2new.txt';
  168.    'unzip e:\download\os2new.zip';
  169.     
  170.     Exit
  171.  
  172.  
  173.